#pragma once
#include <cuda_runtime.h>

#include <cstdlib>
#include <iostream>

#include "common/config.h"
#include "common/data.h"
#include "common/path.h"

class SpaticalSampler {
public:
    SpaticalSampler();
    ~SpaticalSampler();

    int init_memory(const std::vector<RefPoint>& refline, const std::vector<Path>& path_vec);
    int sampling_on_gpu(int size);
    void debug_print(bool is_gpu);
    void dump(std::ofstream& out_file, bool is_gpu) const;

private:
    char* buffer_ = nullptr;
    char* gpu_buffer_ = nullptr;
    char* cpu_buffer_ = nullptr;

    cudaStream_t stream_;
};